<extend name="Public:common"/>
<block name="css">
    <style>
        .type-item {
            background: #ccc;
            min-width: 100px;
            text-align: center;
            padding: 5px 0;
        }
        th{text-align:center;}
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{vertical-align: middle;}
    </style>
</block>
<block name="content">
    <div class="page-header" style="background-color: #fff!important"><h1><i class="fa fa-home"></i> 首页 &gt;产品管理&gt;线路发布
    </h1></div>
    <ul id="nav" class="nav nav-tabs">
        <li role="presentation" class=""><a href="javascript:void(0)">第一步基本信息</a></li>
        <li role="presentation" class="active"><a href="javascript:void(0)">第二步价格计划</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第三步行程安排</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第四步签证添加</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第五步附加产品</a></li>
        <li role="presentation" ><a href="javascript:void(0)">第六步销售渠道</a></li>
    </ul>

    <div class="tab-content">
        <div class="panelsd" style="display: block !important;">
            <!-- 价格计划 第二步-->
            <div class="paneld" style="display: block !important;">
                <form action="{:U('step2_action')}" method="post">
                    <input type="hidden" name="id" value="{:I('id')}">
                    <!-- 隐藏域传递当前是第几步 -->
                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>基础产品</h4>
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">交通方式(去)</label>
                                    <if condition="$line_info['go_traffic_custom'] eq '0'">
                                        <label for="" class="label label-warning">供应商提供</label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>

                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>线路名称</th>
                                            <th>币种</th>
                                            <th>交通方式</th>
                                            <th>座位</th>
                                            <th>数量</th>
                                            <if condition="$line_info['go_traffic_custom'] eq '1'">
                                            <th>成人价</th>
                                            <th>儿童价</th>
                                            </if>
                                        </tr>
                                        <tr>
                                            <td>{$goTraffic.supplier_name}</td>
                                            <td>{$goTraffic.routes_name}</td>
                                            <td>{$goTraffic.money_type}</td>
                                            <td>{$goTraffic.traffic_name}</td>
                                            <td>{$goTraffic.seat_name}</td>
                                            <td>{$goTraffic.seat_num}</td>
                                            <if condition="$line_info['go_traffic_custom'] eq '1'">
                                            <td>{$goTraffic.adult_actual_cost}</td>
                                            <td>{$goTraffic.child_actual_cost}</td>
                                            </if>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">交通方式(回)</label>
                                    <if condition="$line_info['back_traffic_custom'] eq '0'">
                                        <label for="" class="label label-warning">供应商提供</label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>线路名称</th>
                                            <th>币种</th>
                                            <th>交通方式</th>
                                            <th>座位</th>
                                            <th>数量</th>
                                            <if condition="$line_info['back_traffic_custom'] eq '1'">
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            </if>
                                        </tr>
                                        <tr>
                                            <td>{$backTraffic.supplier_name}</td>
                                            <td>{$backTraffic.routes_name}</td>
                                            <td>{$backTraffic.money_type}</td>
                                            <td>{$backTraffic.traffic_name}</td>
                                            <td>{$backTraffic.seat_name}</td>
                                            <td>{$backTraffic.seat_num}</td>
                                            <if condition="$line_info['back_traffic_custom'] eq '1'">
                                            <td>{$backTraffic.adult_actual_cost}</td>
                                            <td>{$backTraffic.child_actual_cost}</td>
                                            </if>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>

                            </div>

                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">打包酒店列表</label>
                                    <if condition="$line_info['room_custom'] eq '0'">
                                        <label class="label label-primary" for="">成本价: <b>{$originLineInfo.hotel_price}</b></label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>
                                    <label class="label label-danger" for="">打包给销售的价格: <b>{$line_info.hotel_price}</b></label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>等级</th>
                                            <th>数量</th>
                                            <if condition="$line_info['room_custom'] eq '1'">
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            </if>
                                        </tr>
                                        <volist name="checkedHotel" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.room_name}</td>
                                                <td>{$vo.star_level}</td>
                                                <td>{$vo.room_count}</td>
                                                <if condition="$line_info['room_custom'] eq '1'">
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                                </if>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>





                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">包含景区列表</label>
                                    <if condition="$line_info['scenic_custom'] eq '0'">
                                        <label for="" class="label label-warning">供应商提供</label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>级别</th>
                                            <if condition="$line_info['scenic_custom'] eq '1'">
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            </if>
                                        </tr>
                                        <volist name="checkedScenic" id="vo">
                                            <tr>
                                                <td>{$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.scenic_name}</td>
                                                <td>{$vo.scenic_level}A</td>
                                                <if condition="$line_info['scenic_custom'] eq '1'">
                                                <td>{$vo.adult_actual_cost}</td>
                                                <td>{$vo.child_actual_cost}</td>
                                                </if>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>

                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>供应商成本价</h4>
                        </div>
                        <div class="col-md-10">

                            <table class="table table-striped table-bordered table-hover table-condensed text-center" >
                                <tbody>
                                <tr>
                                    <th>成人价</th>
                                    <th>儿童价</th>
                                    <!--<th>老人价</th>-->
                                </tr>

                                    <tr>
                                        <td>
                                            {$line_info.adult_money}
                                        </td>
                                        <td> {$line_info.child_money}
                                        </td>
                                       <!-- <td>{$line_info.oldman_money}
                                        </td>-->
                                    </tr>

                                </tbody>
                            </table>

                        </div>
                    </div>


                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>给销售的价格</h4>
                        </div>
                        <div class="col-md-10">
                            <span class="btn btn-primary btn-xs" onclick="addTr()">添加更多价格+</span>

                            <table class="table table-striped table-bordered table-hover table-condensed text-center" id="salesTable">
                                <tbody>
                                <tr>
                                    <th>价格名称</th>
                                    <th>成人价</th>
                                    <th>儿童价</th>
                                  <!--  <th>老人价</th>-->
                                    <th>操作</th>
                                </tr>
                                <if condition="!$priceList">
                                   <tr>
                                        <td>
                                            <input type="text" value="" name="sales[1][price_name]"  placeholder="如:同行价" required>
                                        </td>
                                        <td>
                                            <input type="text" required name="sales[1][adult_price]"  maxlength="10" value=""  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
                                        </td>
                                        <td>
                                            <input type="text" required  name="sales[1][child_price]" maxlength="10" value="" onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
                                        </td>
                                       <!-- <td>
                                            <input type="text" required  name="sales[1][oldman_price]" maxlength="10" value=""onkeyup="clearNoNum(this)"  onafterpaste="clearNoNum(this)">
                                        </td>-->
                                        <td>
                                            <!--<span class="btn btn-warning btn-xs sales_del">删除</span>-->
                                        </td>
                                    </tr>
                                </if>
                                <volist name="priceList" id="vo">
                                    <tr>
                                        <td>
                                            <input type="text" value="{$vo.price_name}" name="sales[{$i}][price_name]"  placeholder="如:同行价" required>
                                        </td>
                                        <td>
                                            <input type="text" required name="sales[{$i}][adult_price]"  maxlength="10" value="{$vo.adult_price}"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
                                        </td>
                                        <td>
                                            <input type="text" required  name="sales[{$i}][child_price]" maxlength="10" value="{$vo.child_price}" onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
                                        </td>
                                     <!--   <td>
                                            <input type="text" required  name="sales[{$i}][oldman_price]" maxlength="10" value="{$vo.oldman_price}"onkeyup="clearNoNum(this)"  onafterpaste="clearNoNum(this)">
                                        </td>-->
                                        <td>
                                            <if condition="$i neq 1">
                                                <span class="btn btn-warning btn-xs sales_del">删除</span>
                                            </if>
                                        </td>
                                    </tr>
                                </volist>
                                </tbody>
                            </table>

                        </div>
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-2 text-right">
                            <h4>可选服务</h4>
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可酒店升级列表</label>
                                    <if condition="$line_info['room_custom'] eq '0'">
                                        <label for="" class="label label-warning">供应商提供</label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>

                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>星级</th>
                                            <th>数量</th>
                                            <th>成本价</th>
                                            <th>升级费用</th>
                                        </tr>

                                        <volist name="upgradeHotel" id="vo">
                                                <tr>
                                                    <td>{$vo.supplier_name}</td>
                                                    <td>{$vo.money_type}</td>
                                                    <td>{$vo.room_name}</td>
                                                    <td>{$vo.star_level}</td>
                                                    <td>{$vo.room_count}</td>
                                                    <td>
                                                        <if condition="$vo['to_operator_price'] gt 0">
                                                            {$vo.to_operator_price}
                                                            <else/>
                                                            成{$vo['origin_adult_price']},儿{$vo.origin_child_price}
                                                        </if>
                                                    </td>
                                                    <td>{$vo.to_reseller_price}</td>
                                                </tr>
                                            </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可选保险</label>
                                    <if condition="$line_info['insure_custom'] eq '0'">
                                        <label for="" class="label label-warning">供应商提供</label>
                                        <else/>
                                        <label for="" class="label label-danger">自己拼加</label>
                                    </if>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>供应商</th>
                                            <th>币种</th>
                                            <th>名称</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            <th>成人销售价</th>
                                            <th>儿童销售价</th>
                                        </tr>
                                        <volist name="checkedInsure" id="vo">
                                            <tr>
                                                <td>

                                                    {$vo.supplier_name}</td>
                                                <td>{$vo.money_type}</td>
                                                <td>{$vo.insure_name}</td>
                                                <td>{$vo.origin_adult_price}</td>
                                                <td>{$vo.origin_child_price}</td>
                                                <td>{$vo.now_adult_price}</td>
                                                <td>{$vo.now_child_price}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-12 col-xs-12">
                                    <label class="type-item ">可选坐席</label>
                                    <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                        <tbody>
                                        <tr>
                                            <th>坐席</th>
                                            <th>币种</th>
                                            <th>出发|回来</th>
                                            <th>数量</th>
                                            <th>成人成本价</th>
                                            <th>儿童成本价</th>
                                            <th>成人销售价</th>
                                            <th>儿童销售价</th>
                                        </tr>
                                        <volist name="upgradeTrafficList" id="vo">
                                            <tr>
                                                <td>
                                                    <if condition="$vo['type'] eq 1">
                                                        <if condition="$vo['go_traffic_custom'] eq '0'">
                                                            <label for="" class="label label-warning">供应商</label>
                                                            <else/>
                                                            <label for="" class="label label-danger">自己拼加</label>
                                                        </if>
                                                    </if>
                                                    <if condition="$vo['type'] eq 2">
                                                        <if condition="$vo['back_traffic_custom'] eq '0'">
                                                            <label for="" class="label label-warning">供应商</label>
                                                            <else/>
                                                            <label for="" class="label label-danger">自己拼加</label>
                                                        </if>
                                                    </if>
                                                    {$vo.seat_name}</td>
                                                <td>{$vo.origin_money_type}</td>
                                                <td>
                                                    <switch name="vo.type">
                                                        <case value="1">出发</case>
                                                        <case value="2">返回</case>
                                                    </switch>
                                                </td>
                                                <td>{$vo.seat_num}</td>
                                                <td>{$vo.origin_adult_price}</td>
                                                <td>{$vo.origin_child_price}</td>
                                                <td>{$vo.now_adult_price}</td>
                                                <td>{$vo.now_child_price}</td>
                                            </tr>
                                        </volist>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>
                    </div>
                    <hr>

                    <if condition="$specialList">
                        <!--特殊价格-->
                        <div id="special">
                           <div class="row">
                               <div class="col-md-2 col-xs-2 text-right"><h4>特殊日期价格列表:</h4></div>
                               <div class="col-md-10 col-xs-10">
                                   <div class="col-md-12 col-xs-12">
                                       <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                           <tbody>
                                           <tr>
                                               <th>日期</th>
                                               <th>成人本价</th>
                                               <th>成人销售价</th>
                                               <th>儿童成本价</th>
                                               <th>儿童销售价</th>
                                               <!--<th>老人成本价</th>
                                               <th>老人销售价</th>-->
                                           </tr>
                                           <volist name="specialList" id="vo">
                                               <tr>
                                                   <td>{$vo.day}</td>
                                                   <td>{$vo.origin_adult_price}</td>
                                                   <td><input type="text" required="required" name="special[{$vo.sprice_id}][adult]"
                                                           maxlength="50" value="{$vo.adult_price}" onkeyup="clearNoNum(this)"
                                                           onafterpaste="clearNoNum(this)">
                                                   </td>
                                                   <td>{$vo.origin_child_price}</td>
                                                   <td>
                                                       <input
                                                               type="text" required="required" name="special[{$vo.sprice_id}][child]"
                                                               maxlength="50" value="{$vo.child_price}" onkeyup="clearNoNum(this)"
                                                               onafterpaste="clearNoNum(this)">
                                                   </td>
                                                   <!--<td>{$vo.origin_oldman_price}</td>
                                                   <td>
                                                       <input
                                                               type="text" required="required" name="special[{$vo.sprice_id}][oldman]"
                                                               maxlength="50" value="{$vo.oldman_price}" onkeyup="clearNoNum(this)"
                                                               onafterpaste="clearNoNum(this)">
                                                   </td>-->
                                               </tr>
                                           </volist>
                                           </tbody>
                                       </table>
                                   </div>
                               </div>
                           </div>

                        </div>
                    </if>
                    <hr>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-5">
                            <div class="row">
                                <div class="col-md-12">
                                    <p>
                                        <span class="text-warning" for="">供应商补房差成本价</span> <b class="text-danger">{$originLineInfo.add_room_price}</b>
                                    </p>
                                    <label class="type-item ">补房差</label>
                                    <input type="tel" name="add_room_price" maxlength="50"
                                           value="{$line_info['add_room_price']}"
                                           onkeyup="clearNoNum(this)"
                                           onafterpaste="clearNoNum(this)"><span>元/人</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">排序</label>
                                    <input type="tel" name="line_sort" value="{$line_info['line_sort']}" maxlength="50"
                                           onkeyup="this.value=this.value.replace(/\D/g,'')"
                                           onafterpaste="this.value=this.value.replace(/\D/g,'')"><span class="explain">数值越小，越优先显示，排序功能仅仅针对您自己的网站</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <label class="type-item ">状态</label>
                                    <input class="form-radio" type='radio' width="30"  name='is_show'
                                    <if condition="$line_info['is_show'] == 0">checked="checked"</if>
                                    value='0'/><span>隐藏</span>
                                    <input class="form-radio" type='radio' width="30"  name='is_show'
                                    <if condition="$line_info['is_show'] == 1">checked="checked"</if>   value='1'/><span>显示</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2 text-right">
                        </div>
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-12">
                                    <p>
                                        <span class="text-warning" for="">供应商线路优惠</span> <b class="text-danger">满{$originLineInfo.discounts_condition}人 优惠{$originLineInfo.discounts}</b>
                                    </p>
                                    <label class="type-item ">优惠设置</label>
                                    满&nbsp;<input type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                                                  name="discounts_condition" maxlength="50"
                                                  value="{$line_info['discounts_condition']}">人
                                    优惠&nbsp;<input type="text" onkeyup="clearNoNum(this)"
                                                   onafterpaste="clearNoNum(this)"
                                                   name="discounts" value="{$line_info['discounts']}"/>元
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row text-center">
                        <a href="{:U('form_step1',array('id'=>I('id')))}" class="btn btn-info">上一步</a>
                        <input type="submit" name="" class="btn btn-warning" value="保存 进入下一步"/>
                        <a class="btn btn-primary" href="{:U('form_step3',array('id'=>I('id')))}">跳过</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/Operator/js/line.js"></script>
    <script>
        function addTr() {
            var trLength=$('#salesTable tbody tr').length;
            var html='';
            html+='<tr><td><input type="text" value="" name="sales['+trLength+'][price_name]"  placeholder="如:同行价" required></td>';
            html+='<td> <input type="text" required name="sales['+trLength+'][adult_price]"  value=""  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)"> </td>';
            html+='<td> <input type="text" required name="sales['+trLength+'][child_price]"  value=""  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)"> </td>';
            //html+='<td> <input type="text" required name="sales['+trLength+'][oldman_price]"  value=""  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)"> </td>';
            html+='<td><span class="btn btn-warning btn-xs sales_del">删除</span></td>';
            $("#salesTable tr:last-child").after(html);
        }

        $('body').on('click','.sales_del',function () {
            $(this).parent().parent('tr').remove();
        });

    </script>
</block>

